package leetcode.code165;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution165 implements IDebug {

	public abstract int compareVersion(String version1, String version2);

	private void debug(String version1, String version2, int expect) {
		int result = this.compareVersion(version1, version2);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug1() {
		String version1 = "1.01";
		String version2 = "1.001";
		int expect = 0;
		this.debug(version1, version2, expect);
	}

	@Override
	public void debug2() {
		String version1 = "1.0";
		String version2 = "1.0.0";
		int expect = 0;
		this.debug(version1, version2, expect);
	}

	@Override
	public void debug3() {
		String version1 = "0.1";
		String version2 = "1.1";
		int expect = -1;
		this.debug(version1, version2, expect);
	}

	@Override
	public void debug4() {
		String version1 = "1.0.1";
		String version2 = "1";
		int expect = 1;
		this.debug(version1, version2, expect);
	}

	public void debug5() {
		String version1 = "7.5.2.4";
		String version2 = "7.5.3";
		int expect = -1;
		this.debug(version1, version2, expect);
	}

}
